/*
 * Copyright (C) 2016  Nicola Spanti (RyDroid) <dev@nicola-spanti.info>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */


#ifndef PLANET_WARS_2D_RT_CORE_MODEL_UNIVERSE_OBSERVER_H
#define PLANET_WARS_2D_RT_CORE_MODEL_UNIVERSE_OBSERVER_H


#include "PlanetWars2dRT-core/utils/observer_essential.h"
#include <stddef.h>


#define UNIVERSE_OBSERVER_CODE_PLANET_CREATED     ((unsigned short) 20)
#define UNIVERSE_OBSERVER_CODE_PLANET_DESTROYED   ((unsigned short) 21)
#define UNIVERSE_OBSERVER_CODE_NB_PLANETS_CHANGED ((unsigned short) 22)
#define UNIVERSE_OBSERVER_CODE_PLANET_LIFE_CHANGE ((unsigned short) 23)

#define UNIVERSE_OBSERVER_CODE_SHIP_CREATED       ((unsigned short) 30)
#define UNIVERSE_OBSERVER_CODE_SHIP_DESTROYED     ((unsigned short) 31)
#define UNIVERSE_OBSERVER_CODE_NB_SHIPS_CHANGED   ((unsigned short) 32)
#define UNIVERSE_OBSERVER_CODE_SHIP_LIFE_CHANGE   ((unsigned short) 33)
#define UNIVERSE_OBSERVER_CODE_SHIP_MOVE          ((unsigned short) 34)


EXTERN_C_BEGIN


void
universe_observer_nb_ships_created_handler(void* an_observable,
					   void* observer_data,
					   void* event_data);

struct observer_t
universe_observer_nb_ships_created_create(size_t* counter);


void
universe_observer_nb_ships_destroyed_handler(void* an_observable,
					     void* observer_data,
					     void* event_data);

struct observer_t
universe_observer_nb_ships_destroyed_create(size_t* counter);


EXTERN_C_END


#endif
